<template>
  <div class="bg-neutral min-h-screen text-dark">
    <!-- 只有在非登录和非注册页面才显示头部 -->
    <Header v-if="$route.path !== '/login' && $route.path !== '/register'" />
    <main>
      <router-view />
    </main>
    <!-- 只有在非登录和非注册页面才显示底部 -->
    <Footer v-if="$route.path !== '/login' && $route.path !== '/register'" />
  </div>
</template>

<script setup>
import Header from './components/Header.vue'
import Footer from './components/Footer.vue'
import { useRoute } from 'vue-router'

// 使用路由对象来判断当前页面
const $route = useRoute()
</script>